<template>
  <h1>El组件-下拉选框</h1>
  <el-select placeholder="请选择喜欢的城市" style="width:500px;" v-model="city">
    <el-option label="南宁" value="nn"></el-option>
    <el-option label="南京" value="nj"></el-option>
    <el-option label="北京" value="bj"></el-option>
    <el-option label="上海" value="sh"></el-option>
  </el-select>
  <h4>用户选择的值：{{city}}</h4>
</template>

<script setup>
import {ref} from "vue";

//定义变量用来保存用户选择的值
const city = ref('nn');
</script>

<style scoped>

</style>